package com.xj.pattern.strategy.context;

import com.xj.pattern.strategy.InstantiationStrategy;
import com.xj.pattern.strategy.impl.CglibSubclassingInstantiationStrategy;

public class AutowireCapableBeanContext {
	private InstantiationStrategy instantiationStrategy = new CglibSubclassingInstantiationStrategy();
	
	public Object autowire(String bean)  {
		return instantiationStrategy.instantiate(bean);
	}

	public InstantiationStrategy getInstantiationStrategy() {
		return instantiationStrategy;
	}
	/**
	 * 如果不使用默认的，则提供一个设置的路径
	 * @param instantiationStrategy
	 */
	public void setInstantiationStrategy(InstantiationStrategy instantiationStrategy) {
		this.instantiationStrategy = instantiationStrategy;
	}
}
